YES 0.988
H-Termination proof of /home/matraf/haskell/eval_FullyBlown_Fast/List.hs
H-Termination of the given Haskell-Program with start terms could successfully be proven:
↳ HASKELL
↳ CR
mainModule List
| ((insert :: Bool -> [Bool] -> [Bool]) :: Bool -> [Bool] -> [Bool]) |
module List where
| import qualified Maybe import qualified Prelude
|
| insert :: Ord a => a -> [a] -> [a]
insert | e ls | = | insertBy compare e ls |
|
| insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]
insertBy | _ x [] | = | x : [] |
insertBy | cmp x ys@(y : ys') | = |
case | cmp x y of |
| GT | -> | y : insertBy cmp x ys' |
| _ | -> | x : ys |
|
|
module Maybe where
| import qualified List import qualified Prelude
|
Case Reductions:
The following Case expression
case | cmp x y of |
| GT | → y : insertBy cmp x ys' |
| _ | → x : ys |
is transformed to
insertBy0 | y cmp x ys' ys GT | = y : insertBy cmp x ys' |
insertBy0 | y cmp x ys' ys _ | = x : ys |
↳ HASKELL
↳ CR
↳ HASKELL
↳ BR
mainModule List
| ((insert :: Bool -> [Bool] -> [Bool]) :: Bool -> [Bool] -> [Bool]) |
module List where
| import qualified Maybe import qualified Prelude
|
| insert :: Ord a => a -> [a] -> [a]
insert | e ls | = | insertBy compare e ls |
|
| insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]
insertBy | _ x [] | = | x : [] |
insertBy | cmp x ys@(y : ys') | = | insertBy0 y cmp x ys' ys (cmp x y) |
|
|
insertBy0 | y cmp x ys' ys GT | = | y : insertBy cmp x ys' |
insertBy0 | y cmp x ys' ys _ | = | x : ys |
|
module Maybe where
| import qualified List import qualified Prelude
|
Replaced joker patterns by fresh variables and removed binding patterns.
Binding Reductions:
The bind variable of the following binding Pattern
ys@(vy : vz)
is replaced by the following term
vy : vz
↳ HASKELL
↳ CR
↳ HASKELL
↳ BR
↳ HASKELL
↳ COR
mainModule List
| ((insert :: Bool -> [Bool] -> [Bool]) :: Bool -> [Bool] -> [Bool]) |
module List where
| import qualified Maybe import qualified Prelude
|
| insert :: Ord a => a -> [a] -> [a]
insert | e ls | = | insertBy compare e ls |
|
| insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]
insertBy | vx x [] | = | x : [] |
insertBy | cmp x (vy : vz) | = | insertBy0 vy cmp x vz (vy : vz) (cmp x vy) |
|
|
insertBy0 | y cmp x ys' ys GT | = | y : insertBy cmp x ys' |
insertBy0 | y cmp x ys' ys vw | = | x : ys |
|
module Maybe where
| import qualified List import qualified Prelude
|
Cond Reductions:
The following Function with conditions
compare | x y |
| | x == y | |
| | x <= y | |
| | otherwise | |
|
is transformed to
compare | x y | = compare3 x y |
compare2 | x y True | = EQ |
compare2 | x y False | = compare1 x y (x <= y) |
compare1 | x y True | = LT |
compare1 | x y False | = compare0 x y otherwise |
compare3 | x y | = compare2 x y (x == y) |
The following Function with conditions
is transformed to
undefined0 | True | = undefined |
undefined1 | | = undefined0 False |
↳ HASKELL
↳ CR
↳ HASKELL
↳ BR
↳ HASKELL
↳ COR
↳ HASKELL
↳ Narrow
mainModule List
| (insert :: Bool -> [Bool] -> [Bool]) |
module List where
| import qualified Maybe import qualified Prelude
|
| insert :: Ord a => a -> [a] -> [a]
insert | e ls | = | insertBy compare e ls |
|
| insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]
insertBy | vx x [] | = | x : [] |
insertBy | cmp x (vy : vz) | = | insertBy0 vy cmp x vz (vy : vz) (cmp x vy) |
|
|
insertBy0 | y cmp x ys' ys GT | = | y : insertBy cmp x ys' |
insertBy0 | y cmp x ys' ys vw | = | x : ys |
|
module Maybe where
| import qualified List import qualified Prelude
|
Haskell To QDPs
↳ HASKELL
↳ CR
↳ HASKELL
↳ BR
↳ HASKELL
↳ COR
↳ HASKELL
↳ Narrow
↳ QDP
↳ ATransformationProof
Q DP problem:
The TRS P consists of the following rules:
new_insertBy(True, :(False, ww41)) → new_insertBy(True, ww41)
R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We have applied the A-Transformation [17] to get from an applicative problem to a standard problem.
↳ HASKELL
↳ CR
↳ HASKELL
↳ BR
↳ HASKELL
↳ COR
↳ HASKELL
↳ Narrow
↳ QDP
↳ ATransformationProof
↳ QDP
↳ QDPSizeChangeProof
Q DP problem:
The TRS P consists of the following rules:
True(False(ww41)) → True(ww41)
R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem. From the DPs we obtained the following set of size-change graphs:
- True(False(ww41)) → True(ww41)
The graph contains the following edges 1 > 1